home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_toolbx.arc / SCN1.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-30  |  1.1 KB  |  53 lines

  1. /*  scn1.c - initialize for screen I/O */
  2.  
  3. #include   "stdio.h"
  4. #include   "video.h"
  5. #include   "scn.h"
  6.  
  7. int  scn_init(pscn)
  8.   SCN_DATA *pscn ;    /* points to screen data area to init */
  9.   {
  10.      int   cols  ;
  11.             /* check video mode and reset */
  12.             /* if not 80 col text */
  13.      switch( vid_state(&cols) & 0x07 )
  14.     {
  15.     case  BW80_MODE :
  16.     case  CO80_MODE :
  17.     case  MONO_MODE :
  18.        break ;
  19.     default  :
  20.        vid_init(BW80_MODE)    ;
  21.        break  ;
  22.     }
  23.  
  24.      scn_addr(pscn) ;            /* set up screen address */
  25.      vid_page(0) ;            /* force page zero */
  26.  
  27.      pscn->cpos = 0 ;            /* current position on screen */
  28.      pscn->cattrib = NORMAL_DISPLAY ;    /* use normal vedeo attr. */
  29.      vid_state(& (pscn->ncols) ) ;    /* get no. columns per line */
  30.   }
  31.  
  32.  
  33.  
  34. int scn_attrib(pscn,a)            /* set screen attribute */
  35.   SCN_DATA *pscn ;
  36.   int    a ;
  37.   {
  38.      pscn->cattrib = a ;
  39.   }
  40.  
  41.  
  42. int  scn_pos(pscn,row,col)        /* set current position on screen */
  43.   SCN_DATA *pscn ;
  44.   int    row   ;
  45.   int    col   ;
  46.   {
  47.      pscn->cpos = (row*(pscn->ncols) + col ) << 1 ;
  48.   }
  49.  
  50.  
  51.  
  52.  
  53.